<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <form action="xxx" onsubmit="return login()">
        
        <p>用户名：<input id="a" type="text" name="username" onblur="check()"></p>
        <p>密码：<input type="password" name="password" ></p>
        <p>性别：
            <input type="radio" name="sex"> 男
            <input type="radio" name="sex" checked="checked"> 女
        </p>
        <p>学历：
            <input type="radio" name="xueli"> 本科
            <input type="radio" name="xueli" checked="checked"> 专科
        </p>
        <p>自我介绍：
            <textarea name="jieshao" id="b" rows="5" cols="30"></textarea>
        </p>
        <p>
            <input type="reset" value="清空">
            <input type="submit" value="提交" onclick="show()">
        </p>

    </form>

    <script>
        
        function check(){
            var name = document.getElementById("a").value;
            if(name != "admin") {
                alert("用户名输入错误！")
            }
        }
        
        function login(){
            var name = document.getElementById("a").value;
            if (name == ""){
                alert("用户名不能为空！");
                return false;
            }
            return true;
        }

        function show(){
            alert("自我介绍：" + document.getElementById("b").value)
        }

    </script>
</body>
</html>